The 'pop( )' Function can be used to remove an item from the Dictionary.
Let us say, we want to remove the entry where the 'Key' is '5' and 'Value' is 'Is a Number'.
x = { 5 : "Is a Number", "John": "Is a Name", "Python": "Is a Language" } x.pop(5) print(x)
So, in the above code we have created a 'Dictionary' using braces '{ }' and 'Key' and 'Value' pairs.
x = { 5 : "Is a Number", "John": "Is a Name", "Python": "Is a Language" }
And initialised to the variable 'x'.
Now, we are supposed to delete the value of the 'Key', '5'.
So, we have used the below way to update it.
And the entry for the 'Key' '5' is deleted for the 'Dictionary'.
And we get the below output,